var datetime  = require('./datetime.js')(); 
//var datetime = date();
console.log(datetime.getMonthDays(2));
console.log(datetime.getnowMonthDays());
console.log(datetime.getWeekStartDate());
console.log(datetime.getWeekEndDate());
console.log(datetime.getMonthStartDate());
console.log(datetime.getMonthEndDate());
console.log(datetime.getLastMonthStartDate());
console.log(datetime.getLastMonthEndDate());
console.log(datetime.getQuarterStartDate());
console.log(datetime.getQuarterEndDate());

let p = new Promise(function(resolve, reject){
    //做一些异步操作
    setTimeout(function(){
        console.log('执行完成');
        resolve('随便什么数据');
        //reject('出错');
    }, 2000);
});

p.then( (res)=>{

	[1,2,3].map( x => 
	{
		console.log(x + 1);

    });
    
    console.log(res);

}).catch((err)=>{

    console.log(err);
});

var people = (name, age) => {
        const fullName = 'h' + name
		console.log(name + ':'+ age);
        return fullName
    }
	
people('xuzheng',18);

class People {
    
    constructor(name,age) {
        this.name = name;
        this.age = age;

    }
    
    getName(){
        return this.name;
    }
    getAge(){
        return this.age;
    }
    
}

let hum = new People('xuzheng',30);

console.log(hum.getName());
console.log(hum.getAge());

console.log('ES6 is good !');
console.log('what is happened!');
